<?php

/**
 * unidadFormacion form base class.
 *
 * @method unidadFormacion getObject() Returns the current form's model object
 *
 * @package    sistema_itec_new
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseunidadFormacionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                       => new sfWidgetFormInputHidden(),
      'nombre'                   => new sfWidgetFormInputText(),
      'etiqueta'                 => new sfWidgetFormInputText(),
      'titulo_id'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Titulo'), 'add_empty' => false)),
      'ambito_id'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Ambito'), 'add_empty' => false)),
      'familia_profesional_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FamiliaProfesional'), 'add_empty' => false)),
      'tipo_unidad_formacion_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TipoUnidadFormacion'), 'add_empty' => false)),
      'tipo_educacion_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TipoEducacion'), 'add_empty' => false)),
      'tipo_formacion_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TipoFormacion'), 'add_empty' => false)),
      'nivel_id'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Nivel'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                       => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'nombre'                   => new sfValidatorString(array('max_length' => 45)),
      'etiqueta'                 => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'titulo_id'                => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Titulo'))),
      'ambito_id'                => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Ambito'))),
      'familia_profesional_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FamiliaProfesional'))),
      'tipo_unidad_formacion_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TipoUnidadFormacion'))),
      'tipo_educacion_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TipoEducacion'))),
      'tipo_formacion_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TipoFormacion'))),
      'nivel_id'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Nivel'))),
    ));

    $this->widgetSchema->setNameFormat('unidad_formacion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'unidadFormacion';
  }

}
